package Code.Menu;

import org.jrabbit.base.core.types.Renderable;
import org.jrabbit.base.core.types.Updateable;
import org.jrabbit.base.graphics.transforms.Vector2d;
import org.jrabbit.base.input.MouseHandler;
import org.jrabbit.base.managers.window.WindowManager;

import Code.Menu.View.*;

public class Menu implements Renderable, Updateable
{
	private Stars stars;
	private Planet planet;
	
	public Menu()
	{
		stars = new Stars();
		planet = new Planet();
	}
	
	public void update(int delta)
	{
		Vector2d offset = MouseHandler.location(true).copy();
		offset.add(-WindowManager.getDisplayWidth() / 2, -WindowManager.getDisplayHeight() / 2);
		
		stars.adjustView(delta, offset);
		planet.adjustView(delta, offset);
	}

	public void render()
	{
		stars.render();
		planet.render();
	}
}
